<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>修改会员</h2>
    </div>

    <div class="cf">
        <!-- 高级搜索 -->
        <!-- <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="title" class="search-input" value="{:I('title')}" placeholder="请输入菜单名称">
                <a class="sch-btn" href="javascript:;" id="search" url="__SELF__"><i class="btn-search"></i></a>
            </div>
        </div> -->
    </div>

    <div class="data-table table-striped">
       <form action="{:U('updateUser')}" method="post" class="form-horizontal">
    <table>
        <tr class="table-tr">
            <td class="table-tr-td" height="120"><p class="font-size-p">头像</p></td><td><img class="img-class-this" width="150" height="150" src="__ROOT__{$data.logo|getimg=###}" /></td>
        </tr>
        <tr class="table-tr">
            <td class="table-tr-td" height="80"><p class="font-size-p">昵称</p></td><td class="font-size-td"><input type="text" name="nickname" value="{$data.nickname}"></td>
        </tr>
        <tr class="table-tr">
            <td class="table-tr-td" height="80"><p class="font-size-p">联系方式</p></td><td class="font-size-td"><input type="text" name="mobile" value="{$data.mobile}" maxlength="11"></td>
        </tr>
        <tr class="table-tr">
            <td class="table-tr-td" height="80"><p class="font-size-p">性别</p></td><td class="font-size-td">
            <input type="radio" name="sex" value="1"<eq name="data.sex" value="1"> checked="checked"</eq>>男
            <input type="radio" name="sex" value="2"<eq name="data.sex" value="2"> checked="checked"</eq>>女
            </td>
        </tr>
        <tr class="table-tr">
            <td class="table-tr-td" height="80"><p class="font-size-p">年龄</p></td><td class="font-size-td"><input type="text" name="age" value="{$data.age}" maxlength="2"></td>
        </tr>
        <tr class="table-tr"><td class="table-tr-td" height="80"><p class="font-size-p">星座</p></td><td class="font-size-td"><select name="constell"><volist name='constell' id='vol'><option value="{$vol.value}" <eq name="vol.value" value="$data.constell"> selected="selected"</eq>>{$vol.title}</option></volist></select></td></tr>
        <tr class="table-tr"><td class="table-tr-td" height="80"><p class="font-size-p">身份</p></td><td class="font-size-td"><select name="identity"><volist name='identity' id='vol'><option value="{$vol.value}" <eq name="vol.value" value="$data.identity"> selected="selected"</eq>>{$vol.title}</option></volist></select></td></tr>
        <tr class="table-tr"><td class="table-tr-td" height="80"><p class="font-size-p">爱好</p></td><td class="font-size-td"><input type="text" name="love" value="{$data.love}"></td></tr>
        <tr class="table-tr">
            <td class="table-tr-td" height="120"><p class="font-size-p">微信二维码</p></td><td><img class="img-class-this" width="150" height="150" src="__ROOT__{$data.qr_code|getimg=###}" /></td>
        </tr>
        <input type="hidden" name="id" value="{$data.id}">
    </table>
     <div height='20' width='100%'><input type="submit" class="ajax-post btn" target-form="form-horizontal" name="buto" id="buto"  value="提交"></div>
</form>
        <!-- 分页 -->
        <div class="page">
            {$page}
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
        $(function() {
            $('.oper').click(function(){
                var mes = $(this).html();
                if (confirm('确定要'+mes+'吗？')) {
                    var id = $(this).attr('data');
                    var val = $(this).attr('val');
                    var flag = $(this).attr('flag');
                    $.post('__CONTROLLER__/edit', {'id': id,'val':val, 'flag':flag}, function(msg) {
                        alert(msg);
                        location.reload();
                    });
                }
            });

            //搜索功能
            $("#search").click(function() {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function(e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });

        });
    </script>
</block>